home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 3: Developer Tools
/
Linux Cubed Series 3 - Developer Tools.iso
/
devel
/
lang
/
lisp
/
stk-3.002
/
stk-3
/
STk-3.1
/
Mp
/
gmp-1.3.2
/
tests
/
urandom.h
< prev
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1993-05-02
|
331 b
|
18 lines
#if defined (hpux) || defined (__alpha__)
/* HPUX lacks random(). DEC Alpha's random() returns a double. */
static inline unsigned long
urandom ()
{
return mrand48 ();
}
#else
long random ();
static inline unsigned long
urandom ()
{
/* random() returns 31 bits, we want 32. */
return random() ^ (random() << 1);
}
#endif